#include"connectionPool.h"
#include<iostream>
#include<ctime>
using namespace std;



int main(){
    /* 
        Connection conn;
        char sql[1024];
        sprintf(sql,"insert into user(name,age,sex) values('%s',%d,'%s');","li",25,"male");
        if(conn.connect("127.0.0.1",3306,"root","123456","test")){
            conn.update(sql);
        }
    */
    //压力测试    
    clock_t begin=clock();
    for(int i=0;i<1000;i++){
        Connection conn;
        char sql[1024];
        sprintf(sql,"insert into user(name,age,sex) values('%s',%d,'%s');","li",25,"male");
        if(conn.connect("127.0.0.1",3306,"root","123456","test")){
            conn.update(sql);
        }
    }
    clock_t end=clock();
    cout<<(end-begin)<<" ms"<<endl;

    return 0;
}